﻿using BoriPeter.FatSecret.Models;
using BoriPeter.FitnessJournal8.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BoriPeter.FatSecret.Converters
{
    public static class FoodsGetFavoritesConverter
    {
        public static List<Food> Convert(this FoodsGetFavoritesModel _favorites)
        {
            List<Food> returnList = new List<Food>();
            if (_favorites.Foods != null)
            {
                foreach (var item in _favorites.Foods)
                {
                    var food = new Food();
                    food.Id = item.FoodId;
                    food.Favorite = true;

                    returnList.Add(food);
                }
            }

            return returnList;
        }
    }
}
